package com.zcxy.util;
import org.apache.pdfbox.tools.imageio.ImageIOUtil;

import java.awt.*;
import java.awt.image.BufferedImage;
import java.io.FileOutputStream;
import java.io.IOException;

public class painterTest2 {


    public static void main(String[] args) {

        BufferedImage bi = new BufferedImage(200, 100, BufferedImage.TYPE_INT_RGB);// INT精确度达到一定,RGB三原色，高度70,宽度150
        Graphics2D g2 = (Graphics2D) bi.getGraphics();
        g2.setRenderingHint (RenderingHints.KEY_ANTIALIASING, RenderingHints.VALUE_ANTIALIAS_ON);
        g2.setPaint(Color.green);
        g2.fillOval(10, 10, 50, 50);
        g2.setPaint(Color.white);
        g2.fillOval(11, 11, 48, 48);
        g2.setPaint(Color.green);
        g2.fillOval(22, 22, 10, 10);
        g2.setPaint(Color.white);
        g2.fillOval(23, 23, 8, 8);
        g2.setPaint(Color.green);
        g2.fillOval(42, 42, 10, 10);
        g2.setPaint(Color.white);
        g2.fillOval(43, 43, 8, 8);


        g2.dispose();
        try {
            ImageIOUtil.writeImage(bi, "JPEG", new FileOutputStream("D:/a.jpg"));
        } catch (IOException e) {
            e.printStackTrace();
        }
    }





}
